/*!
 * Stars
 * A simple index page
 * https://gitee.com/milkpotatoes/stars
 * Copyright (c) 2024 milkpotatoes
 * MIT License
 */

body,
html,
#app,
.wallpaper {
    width: 100%;
    height: 100%;
    padding: 0;
    margin: 0;
    color: white;
    overflow: hidden;
}

@font-face {
    font-family: material-icon;
    src: url("../src/material-icons.woff2");
}

@keyframes clear-wallpaper {
    0% {
        -webkit-backdrop-filter: blur(4px);
        backdrop-filter: blur(4px);
    }

    100% {
        -webkit-backdrop-filter: blur(0px);
        backdrop-filter: blur(0px);
    }
}

@keyframes blur-wallpaper {
    0% {
        -webkit-backdrop-filter: blur(0px);
        backdrop-filter: blur(0px);
    }

    100% {
        -webkit-backdrop-filter: blur(4px);
        backdrop-filter: blur(4px);
    }
}

#app {
    display: grid;
    grid-template-columns: 1fr 960px 1fr;
    grid-template-rows: 1fr 34% 30% 1fr;
    grid-template-areas:
        ". . ."
        ". s ."
        ". l ."
        ". . .";
    justify-items: center;
    align-items: center;
    animation: clear-wallpaper .2s linear 1;
}

#app.expand {
    animation: blur-wallpaper .2s .5s linear 1;
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

#app.expand~.wallpaper {
    filter: blur(64px);
}

.blur {
    -webkit-backdrop-filter: blur(16px) saturate(.8);
    backdrop-filter: blur(16px) saturate(.8);
}

.wallpaper {
    position: absolute;
    background: rgba(0 0 0 / .05) center no-repeat;
    background-size: cover;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    transition: 1s ease-in-out;
    z-index: -1;
}

.material-icon {
    font-family: 'material-icon';
    -webkit-user-select: none;
    user-select: none;
}

#app .settings {
    width: 156px;
    height: 128px;
    opacity: 0;
    position: absolute;
    top: 0px;
    right: 0px;
    transition: ease-in-out .5s;
}

#app .settings:hover {
    opacity: 1;
}

#app .settings .icon {
    display: block;
    width: 36px;
    height: 36px;
    font-size: 24px;
    text-align: center;
    line-height: 36px;
    border-radius: 8px;
    cursor: pointer;
    margin: 32px 32px 0 0;
    transition: ease-in-out .2s;
    float: right;
}

#app .settings .icon:hover {
    background-color: rgba(255 255 255 / .16);
}

.search-box {
    width: 100%;
    max-width: min(640px, 75%);
    position: absolute;
    top: calc(35% - 119px);
}

.search-logo {
    width: 320px;
    height: 150px;
    background: transparent center no-repeat;
    background-size: contain;
    margin: 24px auto;
    cursor: pointer;
    transition: .5s ease-in-out;
    filter: blur(0px) opacity(1);
}

.search-logo.modifying {
    filter: blur(16px) !important;
}

.search-input {
    display: grid;
    grid-template-rows: 40px 1fr;
    grid-template-columns: 32px 1fr 12px;
    background: rgba(0 0 0 / .06);
    width: 100%;
    min-height: 40px;
    align-items: center;
    padding: 0;
    border-radius: 20px;
    box-sizing: border-box;
    position: absolute;
    z-index: 1;
    box-shadow: 0 4px 16px 0px -16px rgba(0 0 0 / .3);
    transition: ease-in-out .2s;
}

.search-input:focus-within {
    background-color: rgba(0 0 0 / .25);
    box-shadow: 0 4px 16px 0px rgba(0 0 0 / .3);
}


.search-input:focus-within>input::placeholder {
    color: rgba(255 255 255 / .5);
}

.search-input>button,
.search-input>input {
    background: none;
    border: none;
    outline: none;
    color: white;
    font-size: 16px;
}

.search-input>button {
    display: none;
    width: 80px;
    border-radius: 20px;
    height: 32px;
    background-color: rgba(0 0 0 / .06);
    transition: ease-in-out .2s;
    cursor: pointer;
    box-shadow: 0 0px 12px -8px rgba(255 255 255 / .08);
}

.search-input>button:hover {
    margin-bottom: 4px;
    background-color: rgba(0 0 0 / .06);
    box-shadow: 0 12px 16px -12px rgba(255 255 255 / .16);
}

.search-select {
    width: 156px;
    background: rgba(0 0 0 / .1);
    border-radius: 20px;
    position: absolute;
    transform: translate(0, -40px);
    -webkit-user-select: none;
    user-select: none;
    transition: ease-in-out .2s;
    overflow: hidden;
    height: calc(var(--items) * 40px);
    display: none;
    grid-auto-rows: 40px;
    grid-auto-columns: 156px;
    z-index: 2;
}

.search-select.hidden {
    width: 124px;
    height: calc(var(--items) * 36px);
    opacity: 0;
}

.search-select div {
    opacity: .8;
    display: grid;
    grid-template-columns: 20px 1fr;
    height: 40px;
    align-items: center;
    gap: 12px;
    padding: 0 8px;
    box-sizing: border-box;
    font-size: 15px;
    transition: inherit;
}

.search-select div:hover {
    background: rgba(0 0 0 / .1);
}

.search-icon {
    cursor: pointer;
    margin-left: 8px;
}

.search-icon,
.search-select div .icon {
    width: 20px;
    height: 20px;
    display: block;
    background: transparent center no-repeat;
    background-size: contain;
    border-radius: 50%;
    transition: ease-in-out .2s;
    outline: solid 2px transparent;
    background-origin: content-box;
    padding: 2px;
}

.manage-search-engine .icon {
    font-size: 20px;
}

.search-icon:hover,
.search-select div.selected .icon {
    background-color: rgba(0 0 0 / .16);
    outline: solid 2px rgba(0 0 0 / .16);
}

.shortcuts {
    grid-area: l;
    grid-template-rows: repeat(2, 100px);
    display: grid;
    gap: 24px;
    grid-template-columns: repeat(8, 96px);
    grid-auto-flow: dense;
    overflow: hidden;
    grid-auto-rows: 100px;
    height: 224px;
    transition: .6s ease-in-out;
    position: relative;
    order: 0;
    scroll-behavior: smooth;
}

.shortcuts::after {
    content: "";
    width: 100%;
    height: calc(100% - 24px);
    display: block;
    position: absolute;
    top: 100%;
    pointer-events: none;
}

.shortcut {
    border-radius: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    transition: ease-in-out .2s;
    --banner-position: -24px;
    --banner-opacity: .2;
    --show-indicator: 0;
}

.shortcut.add-shortcut {
    opacity: 1 !important;
    order: 0 !important;
}

.shortcut:hover {
    --banner-position: 0px;
    --banner-opacity: .8;
    --show-indicator: 1;
    background: rgba(255 255 255 / .1);

}

.shortcut .indicator {
    display: block;
    position: absolute;
    top: 8px;
    background: rgba(255 255 255 /.6);
    width: 12px;
    height: 4px;
    border-radius: 2px;
    cursor: move;
    opacity: var(--show-indicator);
    transition: inherit;
    cursor: none;
}

.shortcut .indicator:hover {
    width: 16px;
    height: 6px;
    top: 6px;
    border-radius: 3px;
}

.shortcut .icon {
    width: 48px;
    height: 48px;
    background: transparent center no-repeat;
    background-size: contain;
    font-size: 32px;
    display: flex;
    justify-content: center;
    align-items: center;
    -webkit-user-select: none;
    user-select: none;
    object-fit: contain;
}

.shortcut .banner {
    position: absolute;
    bottom: var(--banner-position);
    transition: inherit;
    font-size: .8em;
    height: 28px;
    width: 100%;
    display: grid;
    grid-template-rows: repeat(2, 28px);
    opacity: var(--banner-opacity);
    --show-action: 0;
    overflow: hidden;
}

.shortcut .banner:hover {
    --show-action: -100%;
}

.add-shortcut .banner:hover {
    --show-action: 0;
}

.banner>.name,
.banner>.action {
    transform: translateY(var(--show-action));
    transition: inherit;
    -webkit-user-select: none;
    user-select: none;
}

.banner>.name {
    display: block;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
    padding: 0 8px;
    text-align: center;
    line-height: 28px;
    text-overflow: ellipsis;
    white-space: nowrap;
    justify-content: center;
    align-items: center;
}

.banner>.action {
    background: rgba(0 0 0 / .3);
    display: grid;
    grid-template-columns: repeat(2, 24px);
    align-items: center;
    gap: 4px;
    font-size: 16px;
    grid-template-rows: 24px;
    justify-content: center;
    align-content: center;
}

.action>.edit,
.action>.delete {
    text-align: center;
    border-radius: 4px;
    display: block;
    width: 100%;
    height: 100%;
    line-height: 24px;
    cursor: pointer;
}

.action>.edit:hover,
.action>.delete:hover {
    background-color: rgba(0 0 0 / .1);
}

.dragging {
    opacity: .3;
}

@keyframes show-search-box {
    0% {
        filter: opacity(0);
    }

    100% {
        filter: opacity(1);
    }
}

@keyframes hide-search-box {
    0% {
        filter: opacity(1);
    }

    100% {
        filter: opacity(0);
    }
}

.search-box>.search-logo,
.search-box>.search-input {
    animation: show-search-box 1s ease-in-out 1;
}

.search-box>.search-input {
    filter: opacity(1);
}

#app.expand .search-box>.search-logo,
#app.expand .search-box>.search-input {
    animation: hide-search-box 1s ease-in-out 1;
    filter: opacity(0);
    pointer-events: none;
}

#app.expand .shortcuts {
    margin-top: -280px;
    grid-template-rows: repeat(5, 100px);
    height: 596px;
    background: rgba(255 255 255 / .16);
    padding: 24px;
    border-radius: 24px;
}

@keyframes expand-more {

    0% {
        filter: opacity(0);
    }

    100% {
        filter: opacity(1);
    }
}

.shortcuts>.shortcut:nth-child(16)~.shortcut {
    opacity: 0;
    animation: reverse;
    order: 1;
}

.expand .shortcuts>.shortcut:nth-child(16)~.shortcut {
    order: 0;
    opacity: 1;
    animation: expand-more .8s ease-in-out 1;
}

.expand .shortcuts>.shortcut {
    --banner-opacity: .8;
    --banner-position: 0px;
}

@keyframes show-page-indicator {
    0% {
        filter: opacity(0);
    }

    50% {
        filter: opacity(0);
    }

    100% {
        filter: opacity(1);
    }
}

@keyframes hide-page-indicator {
    0% {
        filter: opacity(1);
    }

    50% {
        filter: opacity(0);
    }

    100% {
        filter: opacity(0);
    }
}

.pages-indicator {
    display: flex;
    position: fixed;
    transform: translate(960px, calc(322px - 50%));
    gap: 8px;
    align-items: center;
    filter: opacity(0);
    flex-direction: column;
    width: 24px;
    height: auto;
    animation: hide-page-indicator .6s ease-in-out 1;
    transition: .5s ease-in-out;
}

.expand .pages-indicator {
    filter: opacity(1);
    animation-name: show-page-indicator;
}

.page-indicator {
    width: 8px;
    height: 8px;
    background: #fff;
    border-radius: 50%;
    opacity: .36;
    margin: 1px;
}


.page-indicator:hover {
    opacity: .6;
    margin: 0;
    height: 10px;
    width: 10px;
    transition: .2s ease-in-out;
}

.page-indicator.current {
    opacity: 1;
}

.expand>.shortcut-filter {
    filter: opacity(1);
    transform: translate(0, 0);

}

.shortcut-filter {
    position: absolute;
    top: calc(67% - 504px);
    height: 32px;
    width: 320px;
    background: rgba(255 255 255 / .12);
    border-radius: 8px;
    display: flex;
    filter: opacity(0);
    transition: .6s ease-in-out;
    transform: translate(0, -56px);
}

.shortcut-filter>.material-icon {
    width: 24px;
    height: 24px;
    margin: 4px 0px 4px 4px;
    line-height: 24px;
    text-align: center;
}

.shortcut-filter>input {
    width: 100%;
    height: 100%;
    background: transparent;
    border: none;
    padding: 0 8px 0 0;
    outline: none;
    color: #fff;
}

.search-command.hidden,
.search-help.hidden,
.search-history.hidden {
    opacity: 0;
}

.search-command.hidden>div,
.search-help.hidden>div,
.search-history.hidden>div {
    height: 0;
}

.search-command,
.search-help,
.search-history {
    width: auto;
    display: flex;
    flex-direction: column;
    grid-column-start: 1;
    grid-column-end: 4;
    border-radius: 0 0 20px 20px;
    transition: .2s ease-in-out;
    color: #ddd;
    overflow: hidden;
    -webkit-user-select: none;
    user-select: none;
}

.search-command>div,
.search-help>div,
.search-history>div {
    height: 36px;
    display: flex;
    align-items: center;
    padding: 0 8px;
    transition: .2s ease-in-out;
}

.search-history>div {
    padding: 0 12px;
}

.search-command>.focus,
.search-help>.focus,
.search-history>.focus {
    background: rgba(0 0 0 / .16) !important;
}

.search-command>div:hover,
.search-help>div:hover,
.search-history>div:hover {
    background: rgba(0 0 0 / .1);
}

.search-command>div::after,
.search-help>div::after,
.search-history>div::after,
.search-command>div>span,
.search-help>div>span,
.search-history>div>span {
    background-color: rgba(0 0 0 / .1);
    padding: 2px 4px;
    border-radius: 4px;
    margin: 0 4px;
    line-height: 1.3em;
}

.search-command>div>*,
.search-help>div>*,
.search-history>div>* {
    text-wrap: nowrap;
}

.search-command>div>i,
.search-help>div>i,
.search-history>div>i {
    flex: 0 1 auto;
    font-style: normal;
    width: -moz-fit-content;
    width: fit-content;
    text-overflow: ellipsis;
    overflow: hidden;
    padding-left: .5em;
    text-wrap: nowrap;
}

.search-command>div::after,
.search-help>div::after,
.search-history>div::after,
.search-history>div>.delete {
    content: "Tab";
    margin-left: 1em;
    opacity: 0;
    transition: .2s ease-in-out;
}

.search-command>.focus::after,
.search-help>.focus::after,
.search-history>.focus::after,
.search-history>div:hover>.delete,
.search-history>.focus>.delete {
    opacity: 1;
}

.search-history>div>.delete {
    position: absolute;
    margin: 0;
    right: 12px;
}

.search-history>div>.delete::after {
    content: "";
}

.search-history>.focus>.delete::after {
    content: "Ctrl + D";
    font-family: initial;
}

.search-history>div:hover>.delete::after {
    content: "\e5cd";
    font-family: unset;
}

.widget {
    position: absolute;
    background: rgba(255 255 255 / .75);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    border-radius: 8px;
    box-shadow: 0 16px 16px rgba(0 0 0 / .25);
    overflow: hidden;
    border: solid 1px #aaa;
    -webkit-user-select: none;
    user-select: none;
    z-index: 1;
}

.widget iframe {
    border: none;
    width: 100%;
    height: 100%;
}

.widget>.action {
    position: absolute;
    right: 0;
    left: 0;
    top: 0;
    padding: 4px;
    display: flex;
    justify-content: flex-end;
    gap: 4px;
    opacity: 0;
    transition: .2s ease-in-out;
    background-color: rgba(0 0 0 / .25);
    transform: translate(0, -66%);
}

.widget>.action>.movable {
    width: 100%;
    cursor: move;
}

.widget>.action:hover {
    opacity: 1;
    transform: translate(0, 0);
}

.widget>.action>.material-icon {
    padding: 2px;
    border-radius: 2px;
    transition: .2s ease-in-out;
    cursor: default;
}

.widget>.action>.material-icon:hover {
    background-color: rgba(0 0 0 / .16);
}

.widget>.action>.pin::before,
.widget>.action>.unpin::before {
    content: "push_pin";
    display: inline-block;
    transition: inherit;
}

.widget>.action>.pin::before {
    transform: rotate(45deg);
}

.widget>.resizable {
    display: block;
    width: .5em;
    height: .5em;
    position: absolute;
    bottom: 0;
    right: 0;
    cursor: se-resize;
}
.widget>.resizable:active {
    width: 5em;
    height: 5em;
}